package com.enation.app.javashop.api.client;

import com.enation.app.javashop.model.shop.dos.ShopCatDO;
import com.enation.app.javashop.service.shop.ShopCatManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @author fk
 * @version v2.0
 * @Description: 店铺分类client
 * @date 2018/8/13 15:13
 * @since v7.0.0
 */
@RestController
@RequestMapping("/client/shops/cat")
@ApiIgnore
public class ShopCatClientController {

    @Autowired
    private ShopCatManager shopCatManager;


    /**
     * 获取分类列表
     * @param catPath
     * @return
     */
    @GetMapping
    public List getChildren(@RequestParam("cat_path") String catPath) {
        return shopCatManager.getChildren(catPath);
    }

    @GetMapping("/{cat_id}")
    public ShopCatDO getModel(@PathVariable("cat_id") Long id) {
        return shopCatManager.getModel(id);
    }

}

